﻿using System;
using System.Collections.Generic;
using DevExpress.Xpo;
using System.Text;

namespace BusinessObjects
{
    public class GiangVien : XPObject
    {
        public GiangVien()
            : base()
        {
            // This constructor is used when an object is loaded from a persistent storage.
            // Do not place any code here.
        }

        public GiangVien(Session session)
            : base(session)
        {
            // This constructor is used when an object is loaded from a persistent storage.
            // Do not place any code here.
        }

        public override void AfterConstruction()
        {
            base.AfterConstruction();
            // Place here your initialization code.
        }

        //Fields
        string fMaGiangVien;
        [Size(50)]
        public string MaGiangVien
        {
            get { return fMaGiangVien; }
            set { SetPropertyValue<string>("MaGiangVien", ref fMaGiangVien, value); }
        }
        string fHoGiangVien;
        [Size(50)]
        public string HoGiangVien
        {
            get { return fHoGiangVien; }
            set { SetPropertyValue<string>("HoGiangVien", ref fHoGiangVien, value); }
        }
        string fTenGiangVien;
        [Size(50)]
        public string TenGiangVien
        {
            get { return fTenGiangVien; }
            set { SetPropertyValue<string>("TenGiangVien", ref fTenGiangVien, value); }
        }
        int fHocHam;
        public int HocHam
        {
            get { return fHocHam; }
            set { SetPropertyValue<int>("HocHam", ref fHocHam, value); }
        }
        int fHocVi;
        public int HocVi
        {
            get { return fHocVi; }
            set { SetPropertyValue<int>("HocVi", ref fHocVi, value); }
        }
        string fDienThoai;
        [Size(50)]
        public string DienThoai
        {
            get { return fDienThoai; }
            set { SetPropertyValue<string>("DienThoai", ref fDienThoai, value); }
        }
        string fEmail;
        public string Email
        {
            get { return fEmail; }
            set { SetPropertyValue<string>("Email", ref fEmail, value); }
        }
        Khoa fKhoa;
        [Association(@"GiangVienReferencesKhoa")]
        public Khoa Khoa
        {
            get { return fKhoa; }
            set { SetPropertyValue<Khoa>("Khoa", ref fKhoa, value); }
        }
        [Association(@"GiangVienTrongNamReferencesGiangVien", typeof(GiangVienTrongNam))]
        public XPCollection<GiangVienTrongNam> GiangVienTrongNams { get { return GetCollection<GiangVienTrongNam>("GiangVienTrongNams"); } }
    }
}
